Skip to content

feat: use all common names provided by ncbi for each assembly taxon (#1431)#1520

Open
hunterckx wants to merge 10 commits into
mainfrom
hunter/1431-multiple-common-names
Open

feat: use all common names provided by ncbi for each assembly taxon (#1431)#1520
hunterckx wants to merge 10 commits into
mainfrom
hunter/1431-multiple-common-names

Conversation

@hunterckx

@hunterckx hunterckx commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Description

Updates singular common name fields to instead hold multiple common names, derived from the name lists provided by NCBI

Notes:

  • The common name table columns in the app (which are hidden by default and mainly there for filtering) are updated to display the lists of names in N-tag cells
  • Common names for an organism are aggregated from its assemblies
  • Unlike existing list fields that are saved in the intermediate TSV (which are just comma-separated), common names are saved as JSON, since as far as we're concerned they may contain arbitrary characters
  • Both catalogs have been rebuilt, which for GA2 is just to get the TSV up-to-date; it doesn't include common names in the ultimate JSON output
    • NCBI has moved what is now Megascapheus bottae to its new genus, so I've updated the taxonomy ID in the GA2 source to avoid dropping assemblies from the output
  • "null" is replaced with "None" as the common name value added to a workflow when an assembly lacks a common name; this was a Claude edit that seemed reasonable enough to me

Related Issue

Closes #1431

Copilot AI review requested due to automatic review settings July 25, 2026 00:31
@github-actions github-actions Bot added the feat label Jul 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Expands catalog support for multiple NCBI-provided common names per assembly taxon (and aggregated to organisms), updating build pipelines, API contracts, and UI/table rendering to treat common names as a list rather than a single value.

Changes:

  • Replace singular commonName with list-valued commonNames across shared types, catalog build steps, and backend search/query surfaces.
  • Update UI configs and view model builders to render common names as N-tag lists and update workflow facet keys to use assembly.commonNames.
  • Rebuild and update catalog artifacts (including GA2 taxonomy ID adjustments reflecting NCBI reclassification).

Reviewed changes

Copilot reviewed 31 out of 35 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/views/analyzeWorkflowsView/buildAssemblyWorkflows.scope.test.ts Update workflow-scope test fixtures to use commonNames: [].
tests/analysisMethodCatalogs.utils.test.ts Update catalog util test fixtures to use commonNames: [].
site-config/brc-analytics/local/index/workflow/categoryGroupConfig.ts Point workflow category config at assembly.commonNames for filtering.
site-config/brc-analytics/local/index/organismEntityConfig.ts Switch common names column to NTagCell and buildCommonNames.
site-config/brc-analytics/local/index/genomeEntityConfig.ts Switch common names column to NTagCell and buildCommonNames.
site-config/brc-analytics/category.ts Rename category key from commonName to commonNames.
packages/shared/apis/types.ts Update AssemblyContract to optional list commonNames?: string[].
catalog/py_package/catalog_build/build.py Emit commonNames as JSON-serialized list in species TSV dataframe.
catalog/output/qc-report.data.md Updated QC report output after rebuild.
catalog/output/data-build-meta.json Updated build metadata timestamps and taxdump checksum.
catalog/ga2/source/organisms.yml Update GA2 taxonomy ID to avoid dropping assemblies after NCBI reclassification.
catalog/ga2/output/qc-report.data.md Updated GA2 QC report output after rebuild.
catalog/ga2/output/organisms.json Updated GA2 organisms output after rebuild.
catalog/ga2/output/ncbi-taxa-tree.json Updated GA2 taxa tree reflecting taxonomy/genus changes.
catalog/ga2/output/data-build-meta.json Updated GA2 build metadata timestamps and taxdump checksum.
catalog/ga2/output/assemblies.json Updated GA2 assemblies output after rebuild.
catalog/build/ts/utils.ts Add parseJsonList helper for JSON list parsing.
catalog/build/ts/constants.ts Rename core TSV column key to commonNames.
catalog/build/ts/build-organisms.ts Aggregate organism-level commonNames from assembly-level lists.
catalog/build/ts/build-assemblies.ts Parse row.commonNames as JSON list into assembly entities.
catalog/build/intermediate/outbreak-taxonomy-mapping.tsv Updated intermediate mapping output ordering/content after rebuild.
backend/tests/test_catalog_data.py Update backend tests to validate searching across commonNames.
backend/api/tests/test_catalog_query.py Update organism schema/fixtures to use commonNames arrays and projection expectations.
backend/api/tests/test_catalog_data.py Update API fixtures and add test ensuring secondary common name is searchable.
backend/api/app/services/tools/catalog_query.py Treat commonNames as list field in query allowlists/projections.
backend/api/app/services/tools/catalog_data.py Update search/exact-match/summarization to use commonNames list semantics.
backend/api/app/services/catalog_data.py Update condensed organism records/search field list to commonNames.
app/views/WorkflowsView/utils.ts Map workflow assembly commonNames into facet buckets with defaults.
app/views/WorkflowsView/types.ts Update workflow assembly type to commonNames: string[].
app/viewModelBuilders/catalog/brc-analytics-catalog/common/viewModelBuilders.tsx Replace buildCommonName with buildCommonNames returning NTagCell props.
app/apis/catalog/brc-analytics-catalog/common/entities.ts Update BRC catalog entity types to require commonNames: string[].
Comments suppressed due to low confidence (1)

backend/api/app/services/catalog_data.py:123

  • search_organisms now includes commonNames in a generic str(...).lower() search. Since commonNames is a list, this relies on Python's list stringification (e.g. "['yeast', 'brewer's yeast']"), which is brittle and can introduce surprising matches; it also differs from the dedicated implementation in backend/api/app/services/tools/catalog_data.py that checks each name individually.
        for org in self.organisms:
            if any(
                q in str(org.get(field, "")).lower()
                for field in (
                    "taxonomicLevelSpecies",
                    "taxonomicLevelGenus",
                    "commonNames",
                    "ncbiTaxonomyId",
                    "taxonomicGroup",
                    "taxonomicLevelStrain",
                    "taxonomicLevelIsolate",
                )
            ):

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread catalog/py_package/catalog_build/build.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 25, 2026 00:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 31 out of 35 changed files in this pull request and generated 2 comments.

Comment thread catalog/build/ts/utils.ts
Comment thread backend/api/app/services/tools/catalog_data.py
Copilot AI review requested due to automatic review settings July 25, 2026 01:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 31 out of 35 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Refine common name handling

2 participants